﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SP.DataExchange.BusMessage;
using SP.DataExchange.ServiceBus;

namespace SP.DataExchange.PublishTest
{
    class Program
    {
        static void Main(string[] args)
        {
            IServiceBus bus = new ServiceBus.ServiceBus();

            while (true)
            {
                var name = Console.ReadLine();
                if (name=="q")break;

                var message = new TestLogMessage
                {
                    Id = new Random().Next(0,9999).ToString(),
                    Name = name,
                    CheckInTime = DateTime.Now
                };
                bus.Publish(message);

                Console.WriteLine($"发布用户 : {message.Name} 消息成功 !");
            }
        }
    }
}
